package com.lh.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lh.entity.table.TicketProblemInfoApproval;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface TicketProblemInfoApprovalMapper extends BaseMapper<TicketProblemInfoApproval> {

    /**
     * 批量插入工单问题审批数据（MySQL VALUES 语法 + 注解方式）
     * @param list 待插入的工单问题审批实体列表
     * @return 插入成功的记录数
     */
    @Insert("<script>" +
            "INSERT INTO ticket_problem_info_approval (" +
            "ticket_no, rectification_id,content, risk_level, annex_file, status, is_evaluate, " +
            "evaluate_content, evaluate_score, remark, title, evaluate_time, " +
            "prominent_issue, issue_type, issue_category, issue_sub_category, " +
            "data_resource, resource_description, created_time, complete_deadline, " +
            "complete_description, applicant_name, applicant_phone_number, " +
            "process_handler_id, process_handler_department, process_handler_name, " +
            "process_node_name, end_time, appeal_name, appeal_phone_number, area_name, " +
            "lead_unit, summary_id, task2_id, lead_check, industry_manager, " +
            "manager_check, xjb_check, rectification_objective, rectification_measure, " +
            "acceptance_criteria, participants, meet_deadline, meet_time, " +
            "actually_participants, score, label, charge_leader, leader_position, warn_level" +
            ") VALUES " +
            "<foreach collection='list' item='item' separator=','>" +
            "(#{item.ticketNo}, #{item.rectificationId},#{item.content}, #{item.riskLevel}, #{item.annexFile}, #{item.status}, " +
            "#{item.isEvaluate}, #{item.evaluateContent}, #{item.evaluateScore}, #{item.remark}, " +
            "#{item.title}, #{item.evaluateTime}, #{item.prominentIssue}, #{item.issueType}, " +
            "#{item.issueCategory}, #{item.issueSubCategory}, #{item.dataResource}, " +
            "#{item.resourceDescription}, #{item.createdTime}, #{item.completeDeadline}, " +
            "#{item.completeDescription}, #{item.applicantName}, #{item.applicantPhoneNumber}, " +
            "#{item.processHandlerId}, #{item.processHandlerDepartment}, #{item.processHandlerName}, " +
            "#{item.processNodeName}, #{item.endTime}, #{item.appealName}, #{item.appealPhoneNumber}, " +
            "#{item.areaName}, #{item.leadUnit}, #{item.summaryId}, #{item.task2Id}, #{item.leadCheck}, " +
            "#{item.industryManager}, #{item.managerCheck}, #{item.xjbCheck}, #{item.rectificationObjective}, " +
            "#{item.rectificationMeasure}, #{item.acceptanceCriteria}, #{item.participants}, " +
            "#{item.meetDeadline}, #{item.meetTime}, #{item.actuallyParticipants}, #{item.score}, " +
            "#{item.label}, #{item.chargeLeader}, #{item.leaderPosition}, #{item.warnLevel})" +
            "</foreach>" +
            "</script>")
    int batchInsertByAnnotation(@Param("list") List<TicketProblemInfoApproval> list);
}
